//: -L+pcred


import
	pcred.RegExp ,
	tango.io.device.Array,
	tango.io.device.File,
	tango.io.Stdout;

RegExp re ;

void main(){
	re	= new RegExp(`#define\s+(\w+)\s+(\d+)`, PCRE_DOTALL);
	re.study;

	ge(`SciLexer.h`);
	ge(`Scintilla.h`);
}

void ge(char[] file){
	auto da = cast(char[]) File.get(file);
	auto bu	= new Array(da.length, da.length);
	auto ms	= re.findAll(da);
	if( ms !is null ){
		bu("enum {\n");
		foreach( ma; ms){
			bu("\t")(ma[1])("\t= ")(ma[2])(",\n");
		}
		bu("}\n");
	}
	Stdout.format("{}", cast(char[]) bu.slice );
}